package com.company.pingduoduo;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String source = sc.next();
        int len = source.length();
        int res = 0;
        Set<Pair> pairSet = new HashSet<>();
        for(int i = 1; i < len; i++){
            String leftSub  = source.substring(0, i);
            Set<Double> leftSet = count(leftSub);
            String rightSub = source.substring(i, len);
            Set<Double> rightSet = count(rightSub);
            for(Double item1: leftSet){
                for(Double item2: rightSet){
                    Pair pair = new Pair(item1, item2);
                    pair.partionIndex = i;
                    pairSet.add(pair);
                }
            }
        }
        Set<Pair> removing = new HashSet<>();
        for(Pair pair: pairSet){
            String leftStr;
            if(pair.first == (int) pair.first){
                leftStr = String.valueOf(((int)pair.first));
            }else{
                leftStr = String.valueOf(pair.first).replace(".", "");
            }
            String rightStr;
            if(pair.second == (int) pair.second){
                rightStr = String.valueOf((int)pair.second);
            }else{
                rightStr = String.valueOf(pair.second).replace(".", "");
            }
            String str = leftStr + rightStr;

            if(!source.equals(str)){
                removing.add(pair);
            }
        }
        pairSet.removeAll(removing);
        System.out.println(pairSet.size());
    }

    public static Set<Double> count(String leftSub){
        Set<Double> set = new HashSet<>();
        double temp = Double.parseDouble(leftSub);
        set.add(temp);
        for(int j = 0; j < leftSub.length() + 1; j++){
            String numStr = leftSub.substring(0, j) + "." + leftSub.substring(j, leftSub.length());
            try{
                if(numStr.charAt(0) == '.' || numStr.charAt(numStr.length() - 1) == '.'){
                    continue;
                }
                double num = Double.parseDouble(numStr);
                set.add(num);
            }catch (Exception e){
                continue;
            }
        }
        return set;
    }

    static class Pair{
        double first;
        double second;
        int partionIndex;
        public Pair(double first, double second){
            this.first = first;
            this.second = second;
        }

        @Override
        public boolean equals(Object obj) {
            if(obj instanceof Pair){
                Pair pair = (Pair) obj;
                if(this.first == pair.first && this.second == pair.second){
                    return true;
                }else{
                    return false;
                }
            }else{
                return false;
            }
        }
    }

}
